
package Objects;

import GameEngine.GameConstants.Effect;
import GameEngine.GameConstants.Graphic;
import GameEngine.GameConstants.Material;
import GameEngine.Vector;


/**
 *
 * @author mhfowler
 */
public class Meta extends GameObject {

        /**
     * A constructor
     * @param dir
     * @param min
     * @param max
     */

    private int lifeLimit = Integer.MAX_VALUE;

    public Meta(Vector cen, Vector s) {
        super(new Vector(1,0), cen, s, Graphic.META);
        material = Material.META_ELEMENTS;
        isTangible = false;
    }

    public Meta(Vector cen, Vector s, Graphic g, int ll) {
        super(new Vector(1,0), cen, s, g);
        material = Material.META_ELEMENTS;
        isTangible = false;
        lifeLimit = ll;
    }

    @Override
    public void nextIteration() {
        super.nextIteration();
        if (lifetime > lifeLimit) {
            this.receiveEffect(Effect.DESTROY, size, lifetime);
        }
    }

    @Override
    public void receiveEffect(Effect e, Vector m, int power) {
        switch (e) {
            case DESTROY:
                super.receiveEffect(e, m, power);
                break;
            default:
                // do nothing
                break;
        }
    }

    @Override
    public void collide(GameObject o) {
        // can't be collided with
    }



}
